package com.sth.swing;

import com.sth.test1.MyJComponent1;
import com.sth.test2.MyJComponent2;

import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;

/**
 * @Author: sitianhong
 * @Description:
 * @Since: create in 2021/11/25 0025 9:25
 */
public class MyTabbedPanel extends JPanel {

    public MyTabbedPanel() {
        super(new GridLayout(1, 1));
        JTabbedPane tabbedPane = new JTabbedPane();
        JComponent panel1 = MyJComponent1.getTest1Pannel();
        tabbedPane.addTab("mybatis-plus", panel1);
        tabbedPane.setMnemonicAt(0, KeyEvent.VK_1);

        JComponent panel2 = MyJComponent2.getTest2Pannel();
        tabbedPane.addTab("mybatis(没有做)", panel2);
        tabbedPane.setMnemonicAt(1, KeyEvent.VK_2);
        add(tabbedPane);
    }
}
